package com.baibei.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;

/**
 * 余额
 * {
 * "freezeAmount": "490.28",     // 冻结金额，前端暂不需显示，保留字段
 * "canWithdrawAmount": "0.00",  // 可提现金额
 * "canUseAmount": "999509.58"   // 可交易金额
 * }
 * Created by ChenRui on 2017/8/11 0011 17:14.
 */
public class BalanceInfo implements Parcelable ,Serializable{

    private double balance;
    private double freezeAmount;
    private double canWithdrawAmount;
    private double canUseAmount;

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public double getFreezeAmount() {
        return freezeAmount;
    }

    public void setFreezeAmount(double freezeAmount) {
        this.freezeAmount = freezeAmount;
    }

    public double getCanWithdrawAmount() {
        return canWithdrawAmount;
    }

    public void setCanWithdrawAmount(double canWithdrawAmount) {
        this.canWithdrawAmount = canWithdrawAmount;
    }

    public double getCanUseAmount() {
        return canUseAmount;
    }

    public void setCanUseAmount(double canUseAmount) {
        this.canUseAmount = canUseAmount;
    }

    @Override
    public String toString() {
        return "BalanceInfo{" +
                "balance=" + balance +
                ", freezeAmount=" + freezeAmount +
                ", canWithdrawAmount=" + canWithdrawAmount +
                ", canUseAmount=" + canUseAmount +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeDouble(this.balance);
        dest.writeDouble(this.freezeAmount);
        dest.writeDouble(this.canWithdrawAmount);
        dest.writeDouble(this.canUseAmount);
    }

    public BalanceInfo() {
    }

    protected BalanceInfo(Parcel in) {
        this.balance = in.readDouble();
        this.freezeAmount = in.readDouble();
        this.canWithdrawAmount = in.readDouble();
        this.canUseAmount = in.readDouble();
    }

    public static final Parcelable.Creator<BalanceInfo> CREATOR = new Parcelable.Creator<BalanceInfo>() {
        @Override
        public BalanceInfo createFromParcel(Parcel source) {
            return new BalanceInfo(source);
        }

        @Override
        public BalanceInfo[] newArray(int size) {
            return new BalanceInfo[size];
        }
    };
}
